package doantotnghiep.business;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import doantotnghiep.dao.StaffDao;
import doantotnghiep.model.Staff;
import doantotnghiep.model.WorkPlayment;

public class StaffBusiness {

	@Autowired
	private StaffDao staffDao;
	
	@Autowired
	Staff staff;
	
	public Staff getStaffById(int id) {
		staff = staffDao.findStaffByID(id);
		return staff;
	}
	
	public List<Staff> listStaff() {
		return staffDao.listStaff();
	}
	
	public void addStaff(Staff staff) {
	   staffDao.addStaff(staff);		
	}
	
	public void saveStaffChanged(Staff staff){
		staffDao.saveStaff(staff);		
	}

	public void deleteStaff(int id) {
        staffDao.deleteStaff(id);		
	}

	public List<Staff> getStaffByKey(String key) {
		return staffDao.getStaffByKey(key);
		
	}

	public List<Staff> listEmptyUser() {
		return staffDao.listEmptyUser();
	}

	public List<WorkPlayment> getAllPosition() {
		return staffDao.getListPosition();
	}

	public void initAdmin() {
		staffDao.initAdmin() ;	
	}

	public List<Staff> listImportValidStaff() {
		return staffDao.listImportedValidStaff();
	}

	public List<WorkPlayment> getAllValidPosition() {
		return staffDao.getAllValidPosition();
	}
}
